<template>
  <div class="box">
    <div class="off" v-if="wea === ''">
      <div class="left">
        <p>天气</p>
        <p>加载失败!!</p>
      </div>
      <div class="right"><i class="iconfont icon-cuowu"></i></div>
    </div>
    <div class="wea" v-else>
      <div class="address">{{ wea.city }}</div>
      <div class="temperature">{{ wea.tem }}℃</div>
      <div class="icons">
        <i
          class="iconfont icon-qingtianwawa"
          v-if="
            wea.wea_img === 'qing' ||
            wea.wea_img === 'yin' ||
            wea.wea_img === 'yun'
          "
        ></i>
        <i class="iconfont icon-xiayu" v-else></i>
        <div class="real">{{ wea.wea }}</div>
      </div>
      <div class="high">最高{{ wea.tem1 }}℃ 最低{{ wea.tem2 }}℃</div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    wea: {
      default: ''
    }
  },
  data() {
    return {}
  }
}
</script>

<style lang="less" scoped>
@font-face {
  font-family: fontbobo;
  src: url(@/font/BOBOHEI-2.otf);
}
@import url(@/icon/iconfont/iconfont.css);
.box {
  // display: flex;
  // justify-content: left;
  // align-items: center;
  margin-top: 20px;
  height: 150px;
  width: 250px;
  background-color: #1677b3;
  box-shadow: 0px 0px 4px 0px #8d8b8b;
  border-radius: 10px;
  font-family: 'fontbobo';
}
.icon-cuowu {
  margin-left: 30px;
  font-size: 30px;
}
.off {
  height: 150px;
  // width: 250px;
  color: #f03e3e;
  display: flex;
  font-size: 24px;
  justify-content: center;
  align-items: center;
  // flex-direction: column;
  p {
    margin: 5px 0;
  }
}
.wea {
  color: #fff;
  height: 150px;
  // width: 250px;
  margin-left: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
}
.address {
  font-size: 13px;
}
.temperature {
  font-size: 28px;
}
.icons {
  font-size: 17px;
  display: flex;
  align-items: center;
}
.iconfont {
  color: #f0f5e5;
  margin-right: 10px;
}
.high {
  font-size: 14px;
}
</style>
